<?php

/**
 * 系统钩子类
 * @author bing.peng
 *
 */
class Hook {
	
	function Hook() {
		$this->config = get_config();
	}
	
	/**
	 * 执行钩子
	 * @param $weld 挂接点
	 * @param $hooks 钩子名称
	 * @return void
	 */
	function execute($weld, $hooks) {
		foreach( $hooks as $hook_name ) {
			$hook = $this->config[$weld][$hook_name];
			require_once( ABSPATH . $hook['src'] );
			$HK = new $hook['class'];
			$HK->$hook['func']();
		}
	}
}

?>